package org.iss.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/life")
public class LifeServlet extends HttpServlet {
     private String message="";
    /*1.初始化*/
    @Override
    public void init() throws ServletException {
        System.out.println("init.......");
        message="hello";
    }
    /*2.service*/
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("service.......");
        System.out.println(message);
    }
    /*3.销毁*/
    @Override
    public void destroy() {
       // super.destroy();
    }
}
